extern "C" { 
    #include "apue.h" 
}   
#include <stdio.h>

#include <sys/types.h>
#include <unistd.h>

/*
    off_t lseek(int fd, off_t offset, int whence);
*/
int main(int argc ,char** argv)
{    
    off_t l_seek =lseek(STDIN_FILENO, 0, SEEK_SET);
    if(l_seek==-1)
    {
        err_quit("lseek at fd 0 is err");
    }
    printf("lseek success \n");
}

// lseek 不支持 fifo 管道 和网络套接字
// reallin@ubuntu:~/work/pan/apue/study/3-6-1$ ./exe 
// lseek at fd 0 is err
// reallin@ubuntu:~/work/pan/apue/study/3-6-1$ ./exe <Makefile 
// lseek success 
// reallin@ubuntu:~/work/pan/apue/study/3-6-1$ cat < Makefile  |./exe 
// lseek at fd 0 is err